/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiUI_Controls.h
	Functions for easily creating common controls

******************************************************************************/

//=============================================================================
//	TODO: Maxsi UI is deprecated and should be replaced by something much more
//	elegant, perhaps with the same name, or perhaps even GTK+. It should be
//	lightweight, easy to use, and pretty.
//=============================================================================

#ifndef MaxsiUI_Controls_H
#define MaxsiUI_Controls_H

BeginMaxsiNamespace

//=============================================================================
// Poorly implemented useful functions for creating UI various elements
//=============================================================================

LINK bool	InitializeMaxsiUI_Controls(HANDLE hInstance);

LINK HWND CreateLabelW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H);
LINK HWND CreateLabelA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H);

#ifdef ME_USE_MULTIBYTE_STRING
#define CreateLabel  CreateLabelW
#else
#define CreateLabel  CreateLabelA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateLabelAEx(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H, HFONT hFont);

LINK HWND CreateButtonA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H);
LINK HWND CreateButtonW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H);
#ifdef ME_USE_MULTIBYTE_STRING
#define CreateButton  CreateButtonW
#else
#define CreateButton  CreateButtonA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateTextA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H);
LINK HWND CreateTextW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H);
LINK HWND CreateTextExA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H, DWORD Style);
LINK HWND CreateTextExW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H, DWORD Style);
LINK char*		GetTextAText(HWND hwnd);
LINK wchar_t*	GetTextWText(HWND hwnd);

#ifdef ME_USE_MULTIBYTE_STRING
#define CreateText  CreateTextW
#define CreateTextEx  CreateTextExW
#define GetTextText  GetTextWText
#define SetWindowTextM(HWND,Text) SetWindowTextW(HWND,Text)
#else
#define CreateText  CreateTextA
#define CreateTextEx  CreateTextExA
#define CreateTextEx  CreateTextExA
#define GetTextText  GetTextAText
#define SetWindowTextM(HWND,Text) SetWindowTextA(HWND,Text)
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateRadioButtonA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H, bool Selected);
LINK HWND CreateRadioButtonW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H, bool Selected);
#ifdef ME_USE_MULTIBYTE_STRING
#define CreateButtonRadio  CreateButtonRadioW
#else
#define CreateButtonRadio  CreateButtonRadioA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateCheckButtonA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H, bool Selected);
LINK HWND CreateCheckButtonW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H, bool Selected);
#ifdef ME_USE_MULTIBYTE_STRING
#define CreateCheckRadio  CreateCheckButtonW
#else
#define CreateCheckRadio  CreateCheckButtonA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateProgressBarA(HWND hwnd, LPCSTR Text, int X, int Y, int W, int H);
LINK HWND CreateProgressBarW(HWND hwnd, LPCWSTR Text, int X, int Y, int W, int H);
#ifdef ME_USE_MULTIBYTE_STRING
#define CreateProgressBar  CreateProgressBarW
#else
#define CreateProgressBar  CreateProgressBarA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateTreeViewA(HWND hwnd, char* Unused, int X, int Y, int W, int H);
LINK HWND CreateTreeViewW(HWND hwnd, char* Unused, int X, int Y, int W, int H);
#ifdef ME_USE_MULTIBYTE_STRING
#define CreateTreeView  CreateTreeViewW
#else
#define CreateTreeView  CreateTreeViewA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HTREEITEM AddItemToTreeViewA(HWND hwndTV, LPCSTR lpszItem, int nLevel);
LINK HTREEITEM AddItemToTreeViewW(HWND hwndTV, LPCWSTR lpszItem, int nLevel);
#ifdef ME_USE_MULTIBYTE_STRING
#define AddItemToTreeView AddItemToTreeViewW
#define TVITEMM TVITEMW
#define TVINSERTSTRUCTM TVINSERTSTRUCTW
#else
#define AddItemToTreeView AddItemToTreeViewA
#define TVITEMM TVITEMA
#define TVINSERTSTRUCTM TVINSERTSTRUCTA
#endif // !ME_USE_MULTIBYTE_STRING

LINK HWND CreateListViewM(HWND hwnd);
LINK BOOL AddListViewColumn(HWND List, int Id, MESTR* Name, int Width);

#ifdef ME_USE_MULTIBYTE_STRING
#define WC_LISTVIEWM WC_LISTVIEWW
#define LVCOLUMNM LVCOLUMNW
#define NMLVDISPINFOM NMLVDISPINFOW
#else
#define WC_LISTVIEWM WC_LISTVIEWA
#define LVCOLUMNM LVCOLUMNA
#define NMLVDISPINFOM NMLVDISPINFOA
#endif

EndMaxsiUINamespace

#endif
